home *** CD-ROM | disk | FTP | other *** search
/ Champak 141 / (Vol 141) Oct 17 2011.iso / Games / gamma-bros.swf / scripts / __Packages / classes / fx / ShipSmoke.as < prev    next >
Encoding:
Text File  |  2011-10-17  |  1.5 KB  |  56 lines

  1. class classes.fx.ShipSmoke
  2. {
  3.    var id;
  4.    var x;
  5.    var y;
  6.    var clip;
  7.    var xMov;
  8.    var yMov;
  9.    var c;
  10.    var cMax;
  11.    var alphaStart;
  12.    var black = false;
  13.    var Name = "shipSmoke";
  14.    function ShipSmoke(px, py, pid, pblack)
  15.    {
  16.       this.id = pid;
  17.       this.x = px;
  18.       this.y = py;
  19.       this.black = pblack;
  20.       _root.d = _root.d + 1;
  21.       this.clip = _root.attachMovie("shipSmoke","shipSmoke" + this.id + "Clip",_root.d + 499990);
  22.       this.clip._x = this.x;
  23.       this.clip._y = this.y;
  24.       this.xMov = _root.randRange2(-2,2);
  25.       this.yMov = _root.randRange2(-2,2);
  26.       this.c = 0;
  27.       this.cMax = _root.randRange(15,30);
  28.       this.alphaStart = _root.randRange(50,110);
  29.       var _loc3_ = _root.randRange2(0.7,1.2);
  30.       this.clip._xscale *= _loc3_;
  31.       this.clip._yscale *= _loc3_;
  32.       if(this.black)
  33.       {
  34.          var _loc4_ = new flash.geom.Transform(this.clip);
  35.          var _loc5_ = new flash.geom.ColorTransform(0,0,0,1,-255,-255,-255,0);
  36.          _loc4_.colorTransform = _loc5_;
  37.       }
  38.    }
  39.    function main()
  40.    {
  41.       this.c = this.c + 1;
  42.       if(this.c == this.cMax)
  43.       {
  44.          _root.removeFX("shipSmoke" + this.id);
  45.       }
  46.       this.yMov *= 1.03;
  47.       this.clip._alpha = this.alphaStart - this.c * (this.alphaStart / this.cMax);
  48.       this.clip._xscale *= 1.04;
  49.       this.clip._yscale *= 1.04;
  50.       this.x += this.xMov;
  51.       this.y += this.yMov;
  52.       this.clip._x = this.x;
  53.       this.clip._y = this.y;
  54.    }
  55. }
  56.